﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.EquipmentManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.EquipmentManagement.EquipAlarmRecordVMs
{
    public partial class EquipAlarmRecordTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._EquipAlarmRecord._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.ProductId);
        [Display(Name = "_Model._EquipAlarmRecord._Equipment")]
        public ExcelPropety Equipment_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.EquipmentId);
        [Display(Name = "_Model._EquipAlarmRecord._EquipCode")]
        public ExcelPropety EquipCode_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.EquipCode);
        [Display(Name = "_Model._EquipAlarmRecord._EquipName")]
        public ExcelPropety EquipName_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.EquipName);
        [Display(Name = "_Model._EquipAlarmRecord._OpCode")]
        public ExcelPropety OpCode_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.OpCode);
        [Display(Name = "_Model._EquipAlarmRecord._Address")]
        public ExcelPropety Address_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.Address);
        [Display(Name = "_Model._EquipAlarmRecord._Bits")]
        public ExcelPropety Bits_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.Bits);
        [Display(Name = "_Model._EquipAlarmRecord._Content")]
        public ExcelPropety Content_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.Content);
        [Display(Name = "_Model._EquipAlarmRecord._Level")]
        public ExcelPropety Level_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.Level);
        [Display(Name = "_Model._EquipAlarmRecord._Classify")]
        public ExcelPropety Classify_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.Classify);
        [Display(Name = "_Model._EquipAlarmRecord._StartTime")]
        public ExcelPropety StartTime_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.StartTime, true);
        [Display(Name = "_Model._EquipAlarmRecord._EndTime")]
        public ExcelPropety EndTime_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.EndTime, true);
        [Display(Name = "_Model._EquipAlarmRecord._Duration")]
        public ExcelPropety Duration_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.Duration);
        [Display(Name = "_Model._EquipAlarmRecord._Status")]
        public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.Status);
        [Display(Name = "_Model._EquipAlarmRecord._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.IsValid);
        [Display(Name = "_Model._EquipAlarmRecord._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<EquipmentAlarmRecord>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Equipment_Excel.DataType = ColumnDataType.ComboBox;
            Equipment_Excel.ListItems = DC.Set<Equipment>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class EquipAlarmRecordImportVM : BaseImportVM<EquipAlarmRecordTemplateVM, EquipmentAlarmRecord>
    {
            //import

    }

}